<?php

use Illuminate\Database\Eloquent\Model;

class attachmentcatModel extends Model
{
    protected $table = 'attachment_cat';
    protected $primaryKey = 'id';

    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    protected static function booted()
    {
        //限定查询自营全局作用域
        static::addGlobalScope('dianpu_id', function (Illuminate\Database\Eloquent\Builder $builder) {
            $builder->where('dianpu_id', '=', 0);
        });
    }
}